﻿//using PixelCrushers;
////using PixelCrushers.DialogueSystem;
//using Sirenix.OdinInspector;
//using UnityEngine;


///// 显示应用于对话UI和sequencer的设置。
///// </summary>
//[System.Serializable]
//public class CustomDisplaySettings
//{

//    [HideInInspector]
//    public PixelCrushers.DialogueSystem.ConversationOverrideDisplaySettings conversationOverrideSettings = null;

//    [Tooltip("Assign a GameObject that contains an active dialogue UI component. Can be a prefab. If unassigned, Dialogue Manager will search its children for an active dialogue UI component.")]
//    public GameObject dialogueUI;

//    [LabelText("默认画布"), Tooltip("Optional. Assign Canvas into which dialogue UI will be instantiated if it's a prefab.")]
//    public Canvas defaultCanvas;

//    [System.Serializable]
//    public class LocalizationSettings
//    {
//        /// <summary>
//        /// The current language, or blank to use the default language.
//        /// </summary>
//        [LabelText("     当前使用语言"), Tooltip("当前语言，或为空以使用默认语言。")]
//        public string language = string.Empty;

//        /// <summary>
//        /// Set <c>true</c> to automatically use the system language at startup.
//        /// </summary>
//        [LabelText("     启用系统语言"),Tooltip("在启动时使用系统语言。")]
//        public bool useSystemLanguage = false;

//        /// <summary>
//        /// An optional text table. Used by DialogueSystemController.GetLocalizedText()
//        /// and ShowAlert() if assigned.
//        /// </summary>
//        [LabelText("     可选本地化文本"), Tooltip("用于警报和其他常规文本的可选本地化文本。注意：现在使用文本表而不是本地化文本表。")]
//        public TextTable textTable = null;
//        //---Was: public LocalizedTextTable localizedText = null;
//    }

//    [FoldoutGroup("本地化设置"), HideLabel]
//    public LocalizationSettings localizationSettings = new LocalizationSettings();

//    [System.Serializable]
//    public class SubtitleSettings
//    {
//        /// <summary>
//        /// Specifies whether to show NPC subtitles while speaking a line of dialogue.
//        /// </summary>
//        [LabelText("     是否显示NPC文本"), Tooltip("当NPC讲一行对话时，显示NPC字幕文本")]
//        public bool showNPCSubtitlesDuringLine = true;

//        /// <summary>
//        /// Specifies whether to should show NPC subtitles while presenting the player's follow-up
//        /// responses.
//        /// </summary>
//        [LabelText("     是否显示播放器响应菜单"), Tooltip("显示NPC字幕提示文本，同时显示播放器响应菜单。如果你使用的是标准的对话界面，字幕面板的可视性值优先于此")]
//        public bool showNPCSubtitlesWithResponses = true;

//        /// <summary>
//        /// Specifies whether to show PC subtitles while speaking a line of dialogue.
//        /// </summary>
//        [Tooltip("当电脑讲一行对话时，显示电脑字幕文本。如果勾选响应菜单（如下）后跳过PC字幕，将跳过响应菜单选项中的PC字幕。")]
//        public bool showPCSubtitlesDuringLine = false;

//        /// <summary>
//        /// Set <c>true</c> to allow PC subtitles to be used for the reminder line
//        /// during the response menu.
//        /// </summary>
//        [Tooltip("显示响应菜单时，允许PC字幕用于提醒文本。")]
//        public bool allowPCSubtitleReminders = false;

//        /// <summary>
//        /// If the PC's subtitle came from a response menu selection, don't show the subtitle even if showPCSubtitlesDuringLine is true.
//        /// </summary>
//        [Tooltip("If the PC's subtitle came from a response menu selection, don't show the subtitle even if Show PC Subtitles During Line is ticked.")]
//        public bool skipPCSubtitleAfterResponseMenu = false;

//        /// <summary>
//        /// The default subtitle characters per second. This value is used to compute the default 
//        /// duration to display a subtitle if no sequence is specified for a line of dialogue.
//        /// This value is also used when displaying alerts.
//        /// </summary>
//        [Tooltip("Used to compute default duration to display subtitle. Typewriter effects have their own separate setting.")]
//        public float subtitleCharsPerSecond = 30f;

//        /// <summary>
//        /// The minimum duration to display a subtitle if no sequence is specified for a line of 
//        /// dialogue. This value is also used when displaying alerts.
//        /// </summary>
//        [Tooltip("Minimum default duration to display subtitle.")]
//        public float minSubtitleSeconds = 2f;

//        public enum ContinueButtonMode
//        {
//            /// <summary>
//            /// Never wait for the continue button. Use this if your UI doesn't have continue buttons.
//            /// </summary>
//            Never,

//            /// <summary>
//            /// Always wait for the continue button.
//            /// </summary>
//            Always,

//            /// <summary>
//            /// Show the continue button but don't wait for it.
//            /// </summary>
//            Optional,

//            /// <summary>
//            /// Wait for the continue button, except when the response menu is next show but don't wait.
//            /// </summary>
//            OptionalBeforeResponseMenu,

//            /// <summary>
//            /// Wait for the continue button, except when the response menu is next hide it.
//            /// </summary>
//            NotBeforeResponseMenu,

//            /// <summary>
//            /// Wait for the continue button, except when a PC auto-select response or response
//            /// menu is next, show but don't wait.
//            /// </summary>
//            OptionalBeforePCAutoresponseOrMenu,

//            /// <summary>
//            /// Wait for the continue button, except with a PC auto-select response or response
//            /// menu is next, hide it.
//            /// </summary>
//            NotBeforePCAutoresponseOrMenu,

//            /// <summary>
//            /// Wait for the continue button, except when delivering PC lines show but don't wait.
//            /// </summary>
//            OptionalForPC,

//            /// <summary>
//            /// Wait for the continue button except when delivering PC lines.
//            /// </summary>
//            NotForPC,

//            /// <summary>
//            /// Wait for the continue button, except when preceding response menus or delivering PC lines don't wait.
//            /// </summary>
//            OptionalForPCOrBeforeResponseMenu,

//            /// <summary>
//            /// Wait for the continue button only for NPC lines that don't precede response menus.
//            /// </summary>
//            NotForPCOrBeforeResponseMenu,

//            /// <summary>
//            /// Wait for the continue button, except for PC lines and lines preceding a response menu or PC auto-select response don't wait.
//            /// </summary>
//            OptionalForPCOrBeforePCAutoresponseOrMenu,

//            /// <summary>
//            /// Wait for the continue button only for NPC lines that don't precede response menus or PC auto-select responses.
//            /// </summary>
//            NotForPCOrBeforePCAutoresponseOrMenu,

//            /// <summary>
//            /// Wait for continue button for PC lines but not for NPC lines.
//            /// </summary>
//            OnlyForPC
//        }

//        /// <summary>
//        /// How to handle continue buttons.
//        /// </summary>
//        [Tooltip("How to handle continue buttons.")]
//        public ContinueButtonMode continueButton = ContinueButtonMode.Never;

//        /// <summary>
//        /// Set <c>true</c> to convert "[em#]" tags to rich text codes in formatted text.
//        /// Your implementation of IDialogueUI must support rich text.
//        /// </summary>
//        [Tooltip("Use rich text codes for [em#] markup tags. If unticked, [em#] tag will apply color to entire text.")]
//        public bool richTextEmphases = true;

//        /// <summary>
//        /// Set <c>true</c> to send OnSequenceStart and OnSequenceEnd messages with 
//        /// every dialogue entry's sequence.
//        /// </summary>
//        [Tooltip("Send OnSequenceStart and OnSequenceEnd messages with every dialogue entry's sequence.")]
//        public bool informSequenceStartAndEnd = false;
//    }

    
//    [FoldoutGroup("字幕设置"), HideLabel]
//    public SubtitleSettings subtitleSettings = new SubtitleSettings();

//    [System.Serializable]
//    public class CameraSettings
//    {
//        /// <summary>
//        /// The camera (or prefab) to use for sequences. If unassigned, the sequencer will use the
//        /// main camera; when the sequence is done, it will restore the main camera's original
//        /// position.
//        /// </summary>
//        [Tooltip("Camera or prefab to use for sequences. If unassigned, sequences use the current main camera.")]
//        public Camera sequencerCamera = null;

//        /// <summary>
//        /// An alternate camera object to use instead of sequencerCamera. Use this, for example,
//        /// if you have an Oculus VR GameObject that's a parent of two cameras.  Currently this 
//        /// <em>must</em> be an object in the scene, not a prefab.
//        /// </summary>
//        [Tooltip("If assigned, use instead of Sequencer Camera -- for example, Oculus VR GameObject. Can't be a prefab.")]
//        public GameObject alternateCameraObject = null;

//        /// <summary>
//        /// The camera angle object (or prefab) to use for the "Camera()" sequence command. See
//        /// @ref sequencerCommandCamera for more information.
//        /// </summary>
//        [Tooltip("Camera angle object or prefab. If unassigned, use default camera angle definitions.")]
//        public GameObject cameraAngles = null;

//        /// <summary>
//        /// If conversation's sequences use Main Camera, leave camera in current position at end of conversation instead of restoring pre-conversation position.
//        /// </summary>
//        [Tooltip("If conversation's sequences use Main Camera, leave camera in current position at end of conversation instead of restoring pre-conversation position.")]
//        public bool keepCameraPositionAtConversationEnd = false;

//        /// <summary>
//        /// The default sequence to use if the dialogue entry doesn't have a sequence defined 
//        /// in its Sequence field. See @ref dialogueCreation and @ref sequencer for
//        /// more information. The special keyword "{{end}}" gets replaced by the default
//        /// duration for the subtitle being displayed.
//        /// </summary>
//        [Tooltip("Used when a dialogue entry doesn't define its own Sequence. Set to Delay({{end}}) to leave the camera untouched.")]
//        [TextArea]
//        public string defaultSequence = "Delay({{end}})";

//        [Tooltip("If defined, overrides Default Sequence for player (PC) lines only.")]
//        [TextArea]
//        public string defaultPlayerSequence = string.Empty;

//        [Tooltip("Used when a dialogue entry doesn't define its own Response Menu Sequence.")]
//        [TextArea]
//        public string defaultResponseMenuSequence = string.Empty;

//        /// <summary>
//        /// The format to use for the <c>entrytag</c> keyword.
//        /// </summary>
//        [Tooltip("Format to use for the 'entrytag' keyword.")]
//        public PixelCrushers.DialogueSystem.EntrytagFormat entrytagFormat = PixelCrushers.DialogueSystem.EntrytagFormat.ActorName_ConversationID_EntryID;

//        /// <summary>
//        /// Set <c>true</c> to disable the internal sequencer commands -- for example, if you
//        /// want to replace them with your own.
//        /// </summary>
//        [HideInInspector]
//        public bool disableInternalSequencerCommands = false;
//    }

//    /// <summary>
//    /// The camera settings.
//    /// </summary>
//    [FoldoutGroup("摄像机设置"), HideLabel]
//    public CameraSettings cameraSettings = new CameraSettings();

//    [System.Serializable]
//    public class InputSettings
//    {

//        /// <summary>
//        /// If <c>true</c>, always forces the response menu even if there's only one response.
//        /// If <c>false</c>, you can use the <c>[f]</c> tag to force a response.
//        /// </summary>
//        [Tooltip("Show the response menu even if there's only one response.")]
//        public bool alwaysForceResponseMenu = true;

//        /// <summary>
//        /// If `true`, includes responses whose Conditions are false. The `enabled` field of
//        /// those responses will be `false`.
//        /// </summary>
//        [Tooltip("Include responses whose Conditions are false. typically shown in a disabled state.")]
//        public bool includeInvalidEntries = false;

//        /// <summary>
//        /// If not <c>0</c>, the duration in seconds that the player has to choose a response; 
//        /// otherwise the currently-focused response is auto-selected. If no response is
//        /// focused (e.g., hovered over), the first response is auto-selected. If <c>0</c>,
//        /// there is no timeout; the player can take as long as desired to choose a response.
//        /// </summary>
//        [Tooltip("If nonzero, the duration in seconds until the response menu times out.")]
//        public float responseTimeout = 0f;

//        /// <summary>
//        /// The response timeout action.
//        /// </summary>
//        [Tooltip("What to do if the response menu times out.")]
//        public PixelCrushers.DialogueSystem.ResponseTimeoutAction responseTimeoutAction = PixelCrushers.DialogueSystem.ResponseTimeoutAction.ChooseFirstResponse;

//        /// <summary>
//        /// The em tag to wrap around old responses. A response is old if its SimStatus 
//        /// is "WasDisplayed". You can change this from EmTag.None if you want to visually
//        /// mark old responses in the player response menu.
//        /// </summary>
//        [Tooltip("The [em#] tag to wrap around responses that have been previously chosen.")]
//        public PixelCrushers.DialogueSystem.EmTag emTagForOldResponses = PixelCrushers.DialogueSystem.EmTag.None;

//        /// <summary>
//        /// The em tag to wrap around invalid responses. You can change this from EmTag.None 
//        /// if you want to visually mark invalid responses in the player response menu.
//        /// </summary>
//        [Tooltip("The [em#] tag to wrap around invalid responses. These responses are only shown if Include Invalid Entries is ticked.")]
//        public PixelCrushers.DialogueSystem.EmTag emTagForInvalidResponses = PixelCrushers.DialogueSystem.EmTag.None;

//        /// <summary>
//        /// The buttons QTE (Quick Time Event) buttons. QTE 0 & 1 default to the buttons
//        /// Fire1 and Fire2.
//        /// </summary>
//        [Tooltip("Input buttons mapped to QTEs.")]
//        public string[] qteButtons = new string[] { "Fire1", "Fire2" };

//        /// <summary>
//        /// The key and/or button that allows the player to cancel subtitle sequences.
//        /// </summary>
//        [Tooltip("Key or button that cancels subtitle sequences.")]
//        public PixelCrushers.DialogueSystem.InputTrigger cancel = new PixelCrushers.DialogueSystem.InputTrigger(KeyCode.Escape);

//        /// <summary>
//        /// The key and/or button that allows the player to cancel conversations.
//        /// </summary>
//        [Tooltip("Key or button that cancels active conversation while in response menu.")]
//        public PixelCrushers.DialogueSystem.InputTrigger cancelConversation = new PixelCrushers.DialogueSystem.InputTrigger(KeyCode.Escape);
//    }

//    /// <summary>
//    /// The input settings.
//    /// </summary>
//    [FoldoutGroup("输入设置"), HideLabel]
//    public InputSettings inputSettings = new InputSettings();

//    [System.Serializable]
//    public class BarkSettings
//    {

//        /// <summary>
//        /// Set <c>true</c> to allow barks to play during conversations.
//        /// </summary>
//        [Tooltip("Allow barks to play during conversations.")]
//        public bool allowBarksDuringConversations = true;

//        /// <summary>
//        /// Show barks for this many characters per second. If zero, use Subtitle Settings > Subtitle Chars Per Second.
//        /// </summary>
//        [Tooltip("Show barks for this many characters per second. If zero, use Subtitle Settings > Subtitle Chars Per Second.")]
//        public float barkCharsPerSecond = 0;

//        /// <summary>
//        /// Show barks for at least this many seconds. If zero, use Subtitle Settings > Min Subtitle Seconds.
//        /// </summary>
//        [Tooltip("Show barks  for at least this many seconds. If zero, use Subtitle Settings > Min Subtitle Seconds.")]
//        public float minBarkSeconds = 0;

//    }

//    /// <summary>
//    /// The gameplay alert message settings.
//    /// </summary>
//    [FoldoutGroup("提示音设置"), HideLabel]
//    public BarkSettings barkSettings = new BarkSettings();

//    [System.Serializable]
//    public class AlertSettings
//    {

//        /// <summary>
//        /// Set <c>true</c> to allow the dialogue UI to show alerts during conversations.
//        /// </summary>
//        [Tooltip("Allow the dialogue UI to show alerts during conversations.")]
//        public bool allowAlertsDuringConversations = false;

//        /// <summary>
//        /// How often to check if the Lua Variable['Alert'] has been set. To disable
//        /// automatic monitoring, set this to <c>0</c>.
//        /// </summary>
//        [Tooltip("If nonzero, check Variable['Alert'] at this frequency to show alert messages.")]
//        public float alertCheckFrequency = 0f;

//        /// <summary>
//        /// Show alerts for this many characters per second. If zero, use Subtitle Settings > Subtitle Chars Per Second.
//        /// </summary>
//        [Tooltip("Show alerts for this many characters per second. If zero, use Subtitle Settings > Subtitle Chars Per Second.")]
//        public float alertCharsPerSecond = 0;

//        /// <summary>
//        /// Show alerts for at least this many seconds. If zero, use Subtitle Settings > Min Subtitle Seconds.
//        /// </summary>
//        [Tooltip("Show alerts for at least this many seconds. If zero, use Subtitle Settings > Min Subtitle Seconds.")]
//        public float minAlertSeconds = 0;

//    }

//    /// <summary>
//    /// 游戏提示信息设置。
//    /// </summary>
//    [FoldoutGroup("提示信息设置",1),HideLabel]
//    public AlertSettings alertSettings = new AlertSettings();

//    public bool ShouldUseOverrides()
//    {
//        return (conversationOverrideSettings != null) && conversationOverrideSettings.useOverrides;
//    }

//    public bool ShouldUseSubtitleOverrides()
//    {
//        return ShouldUseOverrides() && conversationOverrideSettings.overrideSubtitleSettings;
//    }

//    public bool GetShowNPCSubtitlesDuringLine()
//    {
//        return ShouldUseSubtitleOverrides() ? conversationOverrideSettings.showNPCSubtitlesDuringLine :
//            ((subtitleSettings != null) ? subtitleSettings.showNPCSubtitlesDuringLine : true);
//    }

//    public bool GetShowNPCSubtitlesWithResponses()
//    {
//        return ShouldUseSubtitleOverrides() ? conversationOverrideSettings.showNPCSubtitlesWithResponses :
//            ((subtitleSettings != null) ? subtitleSettings.showNPCSubtitlesWithResponses : true);
//    }

//    public bool GetShowPCSubtitlesDuringLine()
//    {
//        return ShouldUseSubtitleOverrides() ? conversationOverrideSettings.showPCSubtitlesDuringLine :
//            ((subtitleSettings != null) ? subtitleSettings.showPCSubtitlesDuringLine : true);
//    }

//    public bool GetSkipPCSubtitleAfterResponseMenu()
//    {
//        return ShouldUseSubtitleOverrides() ? conversationOverrideSettings.skipPCSubtitleAfterResponseMenu :
//            ((subtitleSettings != null) ? subtitleSettings.skipPCSubtitleAfterResponseMenu : true);
//    }

//    public float GetSubtitleCharsPerSecond()
//    {
//        return ShouldUseSubtitleOverrides() ? conversationOverrideSettings.subtitleCharsPerSecond :
//            ((subtitleSettings != null) ? subtitleSettings.subtitleCharsPerSecond : 30);
//    }


//    public float GetMinSubtitleSeconds()
//    {
//        return ShouldUseSubtitleOverrides() ? conversationOverrideSettings.minSubtitleSeconds :
//            ((subtitleSettings != null) ? subtitleSettings.minSubtitleSeconds : 2);
//    }

//    //public SubtitleSettings.ContinueButtonMode GetContinueButtonMode()
//    //{
//    //    return ShouldUseSubtitleOverrides() ? conversationOverrideSettings.continueButton :
//    //        ((subtitleSettings != null) ? subtitleSettings.continueButton : SubtitleSettings.ContinueButtonMode.Never);
//    //}

//    public bool ShouldUseSequenceOverrides()
//    {
//        return ShouldUseOverrides() && conversationOverrideSettings.overrideSequenceSettings;
//    }

//    public string GetDefaultSequence()
//    {
//        return ShouldUseSequenceOverrides() && !string.IsNullOrEmpty(conversationOverrideSettings.defaultSequence) ? conversationOverrideSettings.defaultSequence :
//            ((cameraSettings != null) ? cameraSettings.defaultSequence : string.Empty);
//    }

//    public string GetDefaultPlayerSequence()
//    {
//        return ShouldUseSequenceOverrides() && !string.IsNullOrEmpty(conversationOverrideSettings.defaultPlayerSequence) ? conversationOverrideSettings.defaultPlayerSequence :
//            ((cameraSettings != null) ? cameraSettings.defaultPlayerSequence : string.Empty);
//    }

//    public string GetDefaultResponseMenuSequence()
//    {
//        return ShouldUseSequenceOverrides() && !string.IsNullOrEmpty(conversationOverrideSettings.defaultResponseMenuSequence) ? conversationOverrideSettings.defaultResponseMenuSequence :
//            ((cameraSettings != null) ? cameraSettings.defaultResponseMenuSequence : string.Empty);
//    }

//    public bool ShouldUseInputOverrides()
//    {
//        return ShouldUseOverrides() && conversationOverrideSettings.overrideInputSettings;
//    }

//    public bool GetAlwaysForceResponseMenu()
//    {
//        return ShouldUseInputOverrides() ? conversationOverrideSettings.alwaysForceResponseMenu :
//            ((inputSettings != null) ? inputSettings.alwaysForceResponseMenu : true);
//    }

//    public bool GetIncludeInvalidEntries()
//    {
//        return ShouldUseInputOverrides() ? conversationOverrideSettings.includeInvalidEntries :
//            ((inputSettings != null) ? inputSettings.includeInvalidEntries : true);
//    }

//    public float GetResponseTimeout()
//    {
//        return ShouldUseInputOverrides() ? conversationOverrideSettings.responseTimeout :
//            ((inputSettings != null) ? inputSettings.responseTimeout : 0);
//    }

//    public PixelCrushers.DialogueSystem.InputTrigger GetCancelSubtitleInput()
//    {
//        return ShouldUseInputOverrides() ? conversationOverrideSettings.cancelSubtitle :
//            ((inputSettings != null) ? inputSettings.cancel : null);
//    }

//    public PixelCrushers.DialogueSystem.InputTrigger GetCancelConversationInput()
//    {
//        return ShouldUseInputOverrides() ? conversationOverrideSettings.cancelConversation :
//            ((inputSettings != null) ? inputSettings.cancelConversation : null);
//    }

//}
